<!--
 * @Author: zk
 * @Date: 2021-01-21 13:58:15
 * @LastEditors: zk
 * @LastEditTime: 2021-01-22 10:25:53
 * @Description:
-->
<!--
 * @Author: zk
 * @Date: 2021-01-20 16:43:29
 * @LastEditors: zk
 * @LastEditTime: 2021-01-22 09:38:27
 * @Description:
-->
<template>
  <div class="show">

    <!-- 是否体检 -->
    <el-select
      v-model="model.isCheck"
      placeholder="请选择"
      :style="{ width: '100px' }"
      @change="SelectValue($event)"
    >
      <el-option
        v-for="op in isCheckOption"
        :key="op.value"
        :label="op.label"
        :value="op.value"
      />
    </el-select>
    <span class="status">审核状态</span>
    <el-select
      v-model="model.examine"
      placeholder="请选择"
      :disabled="model.isCheck!==2"
      :style="{ width: '100px' }"
      @change="SelectYearValue($event)"
    >
      <el-option
        v-for="op in examineOption"
        :key="op.value"
        :label="op.label"
        :value="op.value"
      />
    </el-select>
  </div>
</template>

<script>
// 加载模拟数据
import { examineType } from '@/simdata/healthData.js'
export default {
  name: 'PhysicalExamination',
  props: {
    model: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      // timeModel: {
      //   isCheck: "", // 是否体检
      //   examine: "" // 审核状态
      // },
      isCheckOption: [
        { label: '全部', value: 0 },
        { label: '未体检', value: 1 },
        { label: '已体检', value: 2 }

      ],
      examineOption: examineType,
      examineD: true
    }
  },
  methods: {
    SelectValue(val) {
      console.log(val)
      if (val == '3') {
        this.examineD = false
      } else if (val == '2') {
        this.examineD = true
        this.model.examine = ''
      } else if (val == '1') {
        this.examineD = true
        this.model.examine = ''
      }
      this.model.isCheck = val
    },
    SelectYearValue(val) {
      console.log(val)
      this.model.examine = val
    }
  }
}
</script>

<style lang="scss" scoped>
.show{
  white-space: nowrap;
}

.status{
  margin-left: 10px;
  line-height: 28px;
  vertical-align: middle;
  font-weight: 700;
  color: #606266;
  font-size:var(--font-size-base);
  white-space: nowrap;
}

</style>
